home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
program
/
swags_z.zip
/
STRINGS.SWG
/
0004_FIND-STR.PAS.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-05-28
|
468b
|
26 lines
Function FirstOccurence(s : String;
c : Char) : Integer; Assembler;
Asm
CLD
LES DI, s
xor CH, CH
xor AH, AH
MOV CL, ES:[DI]
JCXZ @1
MOV BX, CX
inC DI
MOV AL, c
REPNE SCASB
JCXZ @1
SUB BX, CX
XCHG AX, BX
JMP @2
@1:
xor AX, AX
@2:
end;
begin { This example returns 7 }
WriteLn(FirstOccurence('smullen met de pet op dat is pas je ware', 'n'));
end.